#include <iostream>
#include "SpreadsheetCellCtors.h"
using namespace std;


int main()
{
	//SpreadsheetCell myCell(5), anotherCell(4);
	//cout << "cell 1: " << myCell.getValue() << endl;
	//cout << "cell 2: " << anotherCell.getValue() << endl;


	//SpreadsheetCell* myCellp = new SpreadsheetCell(5);
	//SpreadsheetCell* anotherCellp = nullptr;
	//anotherCellp = new SpreadsheetCell(4);

	//

	////... do something with the cells

	//delete myCellp;
	//myCellp = nullptr;
	//delete anotherCellp;
	//anotherCellp = nullptr;


	//SpreadsheetCell aThirdCell("test");		//Use string-arg ctor
	//SpreadsheetCell aFourthCell(4.4);			//Use double-arg ctor
	//SpreadsheetCell* aThirdCellp = new SpreadsheetCell("4.4");	//string-arg ctor

	//cout << "aThirdCell: "  << aThirdCell.getValue() << endl;
	//cout << "aFourthCell: " << aFourthCell.getValue() << endl;
	//cout << "aThirdCellp: " << aThirdCellp->getValue() << endl;

	//delete aThirdCellp;
	//aThirdCellp = nullptr;


	//SpreadsheetCell cells[3];			//FAILS compilation without default constructor
	//SpreadsheetCell* myCellp1 = new SpreadsheetCell[10];	//Alse FAILS



	//在堆栈中创建对象时，调用默认构造函数不需要使用括号
	//SpreadsheetCell myCell;
	//myCell.setValue(6);
	//cout << "cell 1: " << myCell.getValue() << endl;

	//SpreadsheetCell myCell();
	//myCell.setValue(5);

	SpreadsheetCell* myCellp = new SpreadsheetCell();	//Note the function-call syntax



	return 0;
}